package com.qianyitian.hope2.analyzer.controller;

import com.alibaba.fastjson.JSON;
import com.qianyitian.hope2.analyzer.analyzer.DemarkAnalyzer;
import com.qianyitian.hope2.analyzer.analyzer.EStockAnalyzer;
import com.qianyitian.hope2.analyzer.analyzer.IStockAnalyzer;
import com.qianyitian.hope2.analyzer.analyzer.StockAnalyzerFacotry;
import com.qianyitian.hope2.analyzer.config.Constant;
import com.qianyitian.hope2.analyzer.model.AnalyzeResult;
import com.qianyitian.hope2.analyzer.model.ResultInfo;
import com.qianyitian.hope2.analyzer.model.SymbolList;
import com.qianyitian.hope2.analyzer.service.*;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@RestController
public class AnalysisController2 {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    DemarkService demarkService;

    @Autowired
    private StockService stockService;

    @Resource(name = "fileSystemStorageService")
    private IReportStorageService reportService;

    @Autowired
    StockAnalyzerFacotry stockAnalyzerFacotry;
    public AnalysisController2() {
    }
    @Async
    @RequestMapping(value = "/startAnalyze2", method = RequestMethod.GET)
    @Scheduled(cron = "0 22 20 * * MON,TUE,WED,THU,FRI")
    //每周1-5 19:53:00 执行
    public void startAnalyzeInBackgroud() {
        //here will run complex analysis algorithm
        analyzePortfolio(null,null);
    }
    private void analyzePortfolio(String portfolio, String kLineType) {

    }
}
